<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
use think\facade\Route;

/**
 * 帖子
 */
Route::group('posts', function () {
    // 帖子分页查看
    Route::get('pageList', 'v1.posts.PostController/pageList')->option(['real_name' => '帖子分页查看']);
    // 帖子状态修改
    Route::post('status', 'v1.posts.PostController/status')->option(['real_name' => '帖子状态修改']);
    // 帖子删除
    Route::post('delete', 'v1.posts.PostController/delete')->option(['real_name' => '帖子删除']);
    // 查询帖子的评论
    Route::get('comment/list', 'v1.posts.PostController/commentList')->option(['real_name' => '查询帖子的评论']);
    // 帖子评论删除
    Route::post('comment/delete', 'v1.posts.PostController/commentDelete')->option(['real_name' => '帖子评论删除']);
    // 帖子添加
    Route::post('add', 'v1.posts.PostController/add')->option(['real_name' => '帖子添加']);
    // 帖子修改
    Route::post('edit', 'v1.posts.PostController/edit')->option(['real_name' => '帖子修改']);


    // 帖子分类列表
    Route::get('type/list', 'v1.posts.PostsTypeController/list')->option(['real_name' => '帖子分类列表']);
    // 帖子分类添加
    Route::post('type/add', 'v1.posts.PostsTypeController/add')->option(['real_name' => '帖子分类添加']);
    // 帖子分类修改
    Route::post('type/edit', 'v1.posts.PostsTypeController/edit')->option(['real_name' => '帖子分类修改']);
    // 帖子分类删除
    Route::post('type/delete', 'v1.posts.PostsTypeController/delete')->option(['real_name' => '帖子分类删除']);
})->middleware([
    \app\http\middleware\AllowOriginMiddleware::class,
    \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
    \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
    \app\adminapi\middleware\AdminLogMiddleware::class
])->option(['mark' => 'export', 'mark_name' => '数据导出']);
